function [j, a] = normcard( i )
%NORMCARD Summary of this function goes here
%   Detailed explanation goes here

xy = detectmaxline(i);
r = atan(abs(xy(1,2)-xy(2,2))/abs(xy(1,1)-xy(2,1)));
a = rad2deg(r);
j = imrotate(i, -a);
%figure, imshow(j), hold on
%plot(xy(:,1),xy(:,2),'LineWidth',5,'Color','blue');

end

